package com.cskaoyan.market.service.wx.impl;

import com.cskaoyan.market.db.domain.MarketFeedback;
import com.cskaoyan.market.db.mapper.MarketFeedbackMapper;
import com.cskaoyan.market.service.wx.WxFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @Author: wutanzi
 * @Date: 2023/5/23 下午3:58
 * @Version: v1.0.0
 * @Description: 反馈接口的实现类
 **/
@Service
public class WxFeedbackServiceImpl implements WxFeedbackService {

    @Autowired
    MarketFeedbackMapper marketFeedbackMapper;

    @Override
    public int submit(MarketFeedback marketFeedback) {
        LocalDateTime now = LocalDateTime.now();
        marketFeedback.setAddTime(now);
        marketFeedback.setUpdateTime(now);
        //将MarketFeedback对象插入到数据库中，并返回受影响的行数
        return marketFeedbackMapper.insertSelective(marketFeedback);
    }
}
